#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void printtriangle(int tri[10][10])
{
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j <= i; j++)
		{
			printf("%-3d  ", tri[i][j]);
		}
		printf("\n");
	}
}

int main()
{
	int tri[10][10] = { 0 };
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (j == 0 || i == j)
			{
				tri[i][j] = 1;
			}
			if (i > 0 && j > 0)
			{
				tri[i][j] = tri[i - 1][j] + tri[i - 1][j - 1];
			}
		}
	}
	printtriangle(tri);

	return 0;
}